jun.AreaWin = Ext.extend(Ext.Window, {title: "Master Area", modez: 1, width: 400, height: 175, layout: "form", modal: !0, padding: 5, closeForm: !1, initComponent: function () {
    this.items = [
        {xtype: "form", frame: !1, bodyStyle: "background-color: #E4E4E4; padding: 10px", id: "form-Area", labelWidth: 100, labelAlign: "left", layout: "form", ref: "formz", border: !1, items: [
            {xtype: "uctextfield", fieldLabel: "Kode Area", hideLabel: !1, name: "area_code", id: "area_codeid", ref: "../area_code", maxLength: 20, anchor: "100%"},
            {xtype: "uctextfield", fieldLabel: "Nama Area", hideLabel: !1, name: "area_name", id: "area_nameid", ref: "../area_name", maxLength: 100, anchor: "100%"},
            new jun.comboActive({fieldLabel: "Status", hideLabel: !1, width: 100, height: 20, name: "status", id: "statusid", ref: "../status", hiddenName: "status"})
        ]}
    ], this.fbar = {xtype: "toolbar", items: [
        {xtype: "button", text: "Simpan", hidden: !1, ref: "../btnSave"},
        {xtype: "button", text: "Simpan & Tutup", ref: "../btnSaveClose"},
        {xtype: "button", text: "Batal", ref: "../btnCancel"}
    ]}, jun.AreaWin.superclass.initComponent.call(this), this.btnSaveClose.on("click", this.onbtnSaveCloseClick, this), this.btnSave.on("click", this.onbtnSaveclick, this), this.btnCancel.on("click", this.onbtnCancelclick, this), 1 == this.modez || 2 == this.modez ? this.btnSave.setVisible(!1) : this.btnSave.setVisible(!0)
}, btnDisabled: function (status) {
    this.btnSave.setDisabled(status), this.btnSaveClose.setDisabled(status)
}, saveForm: function () {
    this.btnDisabled(!0);
    var urlz;
    urlz = 1 == this.modez || 2 == this.modez ? "Area/update/id/" + this.id : "Area/create/", Ext.getCmp("form-Area").getForm().submit({url: urlz, timeOut: 1e3, scope: this, success: function (f, a) {
        jun.rztArea.reload();
        var response = Ext.decode(a.response.responseText);
        Ext.MessageBox.show({title: "Info", msg: response.msg, buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO}), 0 == this.modez && (Ext.getCmp("form-Area").getForm().reset(), this.btnDisabled(!1)), this.closeForm && this.close()
    }, failure: function (f, a) {
        switch (a.failureType) {
            case Ext.form.Action.CLIENT_INVALID:
                Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                break;
            case Ext.form.Action.CONNECT_FAILURE:
                Ext.Msg.alert(a.response.statusText, a.response.responseText);
                break;
            case Ext.form.Action.SERVER_INVALID:
                Ext.Msg.alert('Failure', a.result.msg);
        }
        this.btnDisabled(!1);
    }})
}, onbtnSaveCloseClick: function () {
    this.closeForm = !0, this.saveForm(!0)
}, onbtnSaveclick: function () {
    this.closeForm = !1, this.saveForm(!1)
}, onbtnCancelclick: function () {
    this.close()
}});